const CRYPTO = require("./crypto")
const moment = require('moment');
const si = require('systeminformation');

// 获取设备id
async function getDeviceId() {
    try {
        const systemInfo = await si.system();
        const deviceId = systemInfo.uuid;
        console.log('Device ID:', deviceId);
        console.log("sec", CRYPTO.encrypted("" + deviceId, "ResetPointer"));
    } catch (error) {
        console.error('Error:', error);
    }
}

async function genKey(deviceId, days) {
    let one = CRYPTO.encrypted(deviceId, "ResetPointer");
    let two = CRYPTO.encryptAES("" + moment().add(days, 'days').valueOf(), deviceId + "ABC123");
    console.log(await getDeviceId());
    console.log(one);
    console.log(one+two);
}


genKey("4ef55487-4fbd-11eb-80eb-8c8caa7bbc97", 10);



